#include <bits/stdc++.h>

using namespace std;

const int MAXN = 1e6+10;
const int mod = 998244353;
const int g = 3;

typedef long long ll;

int qp(ll x,int t){ll res=1;for(;t;t>>=1,x=x*x%mod)if(t&1)res=res*x%mod;return (int)res;}

int rev[MAXN],x[MAXN],x1[MAXN],x2[MAXN],x3[MAXN],x4[MAXN],n,n2,n3,n4,n1;char s[MAXN];

void change(int *f,int l){
	for(int i = 1;i < l;i++) rev[i] = (rev[i>>1]>>1) | (i & 1 ? l >> 1 : 0);
	for(int i = 1;i < l;i++) if(i < rev[i]) swap(f[i],f[rev[i]]);
}

void ntt(int *f,int l,int on){
	change(f,l);
	for(int h = 2;h <= l;h <<= 1){
		int gn = qp(g,(mod-1)/h);
		for(int j = 0;j < l;j += h){
			int gg = 1;
			for(int k = j;k < j + h/2;k++){
				int u = f[k],v = 1ll * f[k + h/2] * gg % mod; 
				f[k] = (u + v) % mod; f[k + h/2] = ((u-v) % mod + mod) % mod; gg = 1ll * gg * gn % mod;
			}
		}
	}
	if(on == -1){reverse(f+1,f+l);int inv = qp(l,mod-2);for(int i = 0;i < l;i++) f[i] = f[i] * 1ll * inv % mod;}
}

void limit(int *arr,int &len){for(int i = 0;i < len;i++) if(arr[i] > 9) arr[i+1]+=arr[i]/10,arr[i]%=10;while(arr[len]){len++;if(arr[len-1]>9)arr[len] += arr[len-1]/10,arr[len-1]%=10;}while(len && arr[len-1]==0) len--;}

void mul(int *a,int &alen,int *b,int blen){
	int l = 1;while(l < alen * 2 || l < blen * 2) l <<= 1;alen = l;
	ntt(a,l,1);ntt(b,l,1);for(int i = 0;i < l;i++) a[i] = 1ll * a[i] * b[i] % mod;ntt(a,l,-1);limit(a,alen);
}

int main (){
	scanf("%s",s);n = strlen(s);
	for(int i = 0;i < n;i++) x1[i] = s[n-i-1] - '0'; x1[0]++;limit(x1,n);n1 = n;
	memcpy(x2,x1,sizeof(x1));n2 = n1; x2[0]++;limit(x2,n2);
	memcpy(x3,x2,sizeof(x2));n3 = n2; x3[0]++;limit(x3,n3);
	memcpy(x4,x3,sizeof(x3));n4 = n3; x4[0]++;limit(x4,n4);
	mul(x1,n1,x2,n2);mul(x1,n1,x3,n3);mul(x1,n1,x4,n4);
	int tmp = 0;
	for(int i = n1-1;i >= 0;i--){
		tmp = tmp * 10 + x1[i];
		if(tmp >= 24) x1[i] = tmp / 24,tmp %= 24;else x1[i] = 0;
	}
	limit(x1,n1);for(int i = n1-1;i >= 0;i--) putchar(x1[i] + '0');puts("");return 0;
}
